<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="./../../template/tagedu.xhtml">

    <ui:define name="title">
        <title><h:outputText value="Criar Campanha - TAG"/></title>
    </ui:define>

    <ui:define name="content">
        <h:outputText styleClass="enrollmentName" value="Criar Campanha"/>
        <h:form id="campaignForm">
            <p:messages id="message" autoUpdate="true"/>
            <p:panel header="Digite Os Dados"> 
            
            <h:panelGrid columns="2" >
                <h:outputText value="Nome:"/>
                <p:inputText value="#{campaignB.campaign.name}" label="Nome"  required="true" 
                             requiredMessage="Digite o nome da Campanha"/>  
                
                <h:outputText value="Data Início:"/>
                <p:calendar value="#{campaignB.campaign.initialDate.time}" label="Data"/>
                
                <h:outputText value="Data de Termino:"/>
                <p:calendar value="#{campaignB.campaign.terminalDate.time}" label="Data"/>
                
                <h:outputText value ="Tipo:"/>  
                <p:selectOneMenu value="#{campaignB.campaign.type}" required="true" requiredMessage="Escolha o tipo da campanha">
                    <f:selectItem itemLabel="Selecione o tipo" />
                    <f:selectItem itemLabel="Nutricional" itemValue="NUTRICIONAL"/>   
                    <f:selectItem itemLabel="Anemia Ferropriva" itemValue="ANEMIA_FERROPRIVA" />
                </p:selectOneMenu>
                
                <p:commandButton style="margin:10px auto;display:block;"
                    update="@form" action="#{campaignB.save()}" value="Salvar"/>
                
            </h:panelGrid>
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>